Skip to content

Support Laravel 13 - #228

Open
austinderrick wants to merge 2 commits into
wintercms:wip/1.3from
austinderrick:wip/1.3-laravel-13
Open

austinderrick wants to merge 2 commits into
wintercms:wip/1.3from
austinderrick:wip/1.3-laravel-13

Conversation

@austinderrick

@austinderrick austinderrick commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #207 (Laravel 12 support) and continues the 1.3 line. This PR moves Storm to Laravel 13.

Required by wintercms/winter#1487 (Winter CMS Laravel 13 support).

Summary

Laravel 13 was released on 2026-03-17 and requires PHP 8.3. Storm overrides several framework internals, so this PR has four code changes as well as the dependency updates.

Dependency changes (composer.json)

  • php: ^8.2 → ^8.3 (the Laravel 13 minimum)
  • laravel/framework: ^12.30.1 → ^13.0
  • laravel/tinker: ^2.8.1 → ^3.0
  • nesbot/carbon: ^3.0 → ^3.8.4
  • symfony/console, symfony/process and symfony/yaml: → ^7.4|^8.0
  • orchestra/testbench: ^10.0 → ^11.0
  • phpunit/phpunit: ^11.0 → ^11.5.50. Laravel 13 and Testbench 11 require at least 11.5.50. PHPUnit stays on 11.x because meyfa/phpunit-assert-gd and dms/phpunit-arraysubset-asserts have no PHPUnit 12 release yet.
  • The pieterocp/phpunit-arraysubset-asserts VCS repository now sets "no-api": true. Composer then clones it with plain git, so installs work without a GitHub API token. CI for pull requests from forks has no token.

Code changes

  • ArraySource trait. Laravel 13 throws a LogicException when a model is instantiated while it is still booting. bootArraySource() created the SQLite datasource during boot, which calls new static and static::insert(). The datasource is now built lazily, the first time resolveConnection() is called for the model, when the model has finished booting.
    • Connections are stored per model class. A static property declared in a trait is shared with subclasses, so a single property would let a subclass reuse its parent's datasource.
    • bootArraySource() discards the class's connection. After Model::clearBootedModels(), the next query rebuilds the datasource, as it did when boot built it.
    • A model that queries its own connection while it is being constructed gets a clear ApplicationException instead of infinite recursion.
  • Container log alias (Foundation/Application). Storm aliased the log service to Illuminate\Log\Logger, but the service is a LogManager. Resolving Illuminate\Log\Logger therefore returned a LogManager, and code that type-hints Logger failed with a TypeError. Laravel Debugbar 4's log collector does this. The alias is now Illuminate\Log\LogManager, which matches Laravel core.
  • Foundation/Console/DownCommand. Laravel 13 added --with-secret to down. The override now passes $this->getSecret() instead of $this->option('secret'), so a generated secret works. getSecret() also exists in Laravel 12.
  • PHPStan. Laravel 13's relation classes are generic. The relation factory methods in Database/Concerns/HasRelationships.php now declare @param Builder<Model> $query, so the builder they pass matches the relation constructors. Auth/Models/Preferences now documents its applyKeyAndUser scope as returning Builder<static>. Entries that no longer match were removed from phpstan-baseline.neon, and the MailFake::queue entry was updated to Laravel 13's signature.

CI

  • tests.yml: the PHP matrix drops 8.2 and is now ['8.3', '8.4', '8.5'].
  • code-quality.yaml: PHP 8.2 → 8.3.

Testing

Run locally on PHP 8.4 with Laravel 13.33.0 and PHPUnit 11.5.56:

  • vendor/bin/phpunit: 850 tests, 0 failures, 9 skipped.
  • tests/Database/Traits/ArraySourceTest.php has two new tests. The first checks that a subclass of an ArraySource model reads its own records. The second checks that the datasource is rebuilt after Model::clearBootedModels(). Both tests fail without the per-class connections.
  • PHPCS is clean on the changed files, and PHPStan reports no errors in ArraySource.php.

MarkdownTest (the simple_table case) fails on any fresh install that resolves league/commonmark 2.10.2 or later, because those releases changed how tables are parsed. This does not come from this PR. With league/commonmark 2.10.1 installed, the full suite passes as listed above.

Related Winter CMS Laravel 13 PRs

@coderabbitai

coderabbitai Bot commented Jun 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: da10f92b-8469-412e-8e8d-f2794f164394

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This PR upgrades Winter CMS Storm to require PHP 8.3 minimum, updates CI workflows and composer dependencies to match, refines PHPDoc type annotations to document Eloquent Builder generics consistently across Preferences and relation factories, implements lazy initialization for ArraySource SQLite connections to defer boot until first use, adjusts DownCommand payload generation logic, removes four now-resolved PHPStan baseline suppressions, and updates test expectations for scheduled call output formatting.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Support Laravel 13' directly and clearly summarizes the main objective of the pull request, which is to add Laravel 13 compatibility.
Docstring Coverage ✅ Passed Docstring coverage is 88.24% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@austinderrick

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Move Storm to Laravel 13 (PHP 8.3+): bump the framework, Tinker, Carbon, Symfony, PHPUnit and
Testbench constraints, build the ArraySource datasource lazily with a connection per model class,
alias the log service to LogManager, use getSecret() in DownCommand, add the relation factory
Builder<Model> docblocks, and update the PHPStan baseline and CI matrix.
austinderrick added a commit to austinderrick/winter that referenced this pull request Sep 24, 2026
Move Winter to Laravel 13 (PHP 8.3+): bump the framework and PHPUnit constraints in the root and
module manifests, use Arr::last() in VersionManager, resolve Storm and the modules from the Laravel
13 branches until wintercms/storm#228 merges, and update the CI matrix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants